package edu.chalmers.gos;

import org.cocos2d.nodes.CCLabel;
import org.cocos2d.nodes.CCNode;
import org.cocos2d.types.CGPoint;
import org.cocos2d.types.CGRect;

import edu.chalmers.targine.ARManager;
import edu.chalmers.targine.CocosComponent;

public class Text implements CocosComponent {
	private CCLabel label;
	
	public Text(float startX, float startY, String title){
		label = CCLabel.makeLabel(title, "Verdana", 20);
		label.setPosition(startX, startY);
	}

	public void update(float dt, ARManager arManager) {
		// TODO Auto-generated method stub
	}

	public boolean isIntersecting(CGRect fingerRect) {
		// TODO Auto-generated method stub
		return false;
	}

	public void touchBegan(int touchID, CGPoint touchPoint) {
		// TODO Auto-generated method stub
		
	}

	public void updateTouch(int touchID, CGPoint touchPoint) {
		// TODO Auto-generated method stub
		
	}

	public boolean hasTouchID(int touchID) {
		// TODO Auto-generated method stub
		return false;
	}

	public void touchEnded(int touchID, ARManager arManager) {
		// TODO Auto-generated method stub
		
	}

	public CCNode getNode() {
		return label;
	}

	public void setVisible(boolean visible) {
		label.setVisible(visible);
	}

	public boolean isVisible() {
		return label.getVisible();
	}
	
	public void setText(String text){
		try{
			label.setString(text);
		} catch(Exception e){
			label = CCLabel.makeLabel(text, "Verdana", 20);
			e.printStackTrace();
		}
	}

}
